// updateOrganizationActivityShareCount
exports.updateOrganizationActivityShareCount = function (req, res) {

    var bodyParams = req.routeInfo.bodyParams;

    var shareCount = 0;

    //任务流创建
    async.waterfall([
            function (cb) {
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchOrganizationActivity + "/oa_id/" + bodyParams.oa_id,
                        method: 'POST',
                        data: {
                            fields: ["oa_share_count"].join(",")
                        }
                    },
                    function (err, data) {

                        //判断是否有错误信息
                        if (err) {
                            return cb(err, data);
                        }

                        shareCount = data.data[0].oa_share_count;
                        cb();
                    }
                );

            },
            //更新分享记录
            function (cb) {
                if (shareCount != "") {
                    R.SEND_HTTP(
                        req,
                        {
                            url: CORE_APIConfig.coreAPI.updateOrganizationActivity,
                            method: 'POST',
                            data: {
                                oa_id: bodyParams.oa_id,
                                oa_share_count: parseInt(shareCount) + 1
                            }
                        },
                        function (err, data) {

                            cb();
                        }
                    );
                } else {
                    cb()
                }


            }
        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true);

        }
    );

}